Optimal. Leaf size=235 \[ -\frac {B (b c-a d) g \left (a^2 d^2 g^2-a b d g (4 d f-c g)+b^2 \left (6 d^2 f^2-4 c d f g+c^2 g^2\right )\right ) n x}{4 b^3 d^3}-\frac {B (b c-a d) g^2 (4 b d f-b c g-a d g) n x^2}{8 b^2 d^2}-\frac {B (b c-a d) g^3 n x^3}{12 b d}-\frac {B (b f-a g)^4 n \log (a+b x)}{4 b^4 g}+\frac {(f+g x)^4 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{4 g}+\frac {B (d f-c g)^4 n \log (c+d x)}{4 d^4 g} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.21, antiderivative size = 235, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.067, Rules used = {2547, 84}
\begin {gather*} -\frac {B g n x (b c-a d) \left (a^2 d^2 g^2-a b d g (4 d f-c g)+b^2 \left (c^2 g^2-4 c d f g+6 d^2 f^2\right )\right )}{4 b^3 d^3}+\frac {(f+g x)^4 \left (B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )+A\right )}{4 g}-\frac {B n (b f-a g)^4 \log (a+b x)}{4 b^4 g}-\frac {B g^2 n x^2 (b c-a d) (-a d g-b c g+4 b d f)}{8 b^2 d^2}-\frac {B g^3 n x^3 (b c-a d)}{12 b d}+\frac {B n (d f-c g)^4 \log (c+d x)}{4 d^4 g} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 84
Rule 2547
Rubi steps
\begin {align*} \int (f+g x)^3 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right ) \, dx &=\frac {(f+g x)^4 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{4 g}-\frac {(B n) \int \frac {(b c-a d) (f+g x)^4}{(a+b x) (c+d x)} \, dx}{4 g}\\ &=\frac {(f+g x)^4 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{4 g}-\frac {(B (b c-a d) n) \int \frac {(f+g x)^4}{(a+b x) (c+d x)} \, dx}{4 g}\\ &=\frac {(f+g x)^4 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{4 g}-\frac {(B (b c-a d) n) \int \left (\frac {g^2 \left (a^2 d^2 g^2-a b d g (4 d f-c g)+b^2 \left (6 d^2 f^2-4 c d f g+c^2 g^2\right )\right )}{b^3 d^3}+\frac {g^3 (4 b d f-b c g-a d g) x}{b^2 d^2}+\frac {g^4 x^2}{b d}+\frac {(b f-a g)^4}{b^3 (b c-a d) (a+b x)}+\frac {(d f-c g)^4}{d^3 (-b c+a d) (c+d x)}\right ) \, dx}{4 g}\\ &=-\frac {B (b c-a d) g \left (a^2 d^2 g^2-a b d g (4 d f-c g)+b^2 \left (6 d^2 f^2-4 c d f g+c^2 g^2\right )\right ) n x}{4 b^3 d^3}-\frac {B (b c-a d) g^2 (4 b d f-b c g-a d g) n x^2}{8 b^2 d^2}-\frac {B (b c-a d) g^3 n x^3}{12 b d}-\frac {B (b f-a g)^4 n \log (a+b x)}{4 b^4 g}+\frac {(f+g x)^4 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )}{4 g}+\frac {B (d f-c g)^4 n \log (c+d x)}{4 d^4 g}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.20, size = 219, normalized size = 0.93 \begin {gather*} \frac {(f+g x)^4 \left (A+B \log \left (e \left (\frac {a+b x}{c+d x}\right )^n\right )\right )-\frac {B n \left (6 b d (b c-a d) g^2 \left (a^2 d^2 g^2+a b d g (-4 d f+c g)+b^2 \left (6 d^2 f^2-4 c d f g+c^2 g^2\right )\right ) x+3 b^2 d^2 (b c-a d) g^3 (4 b d f-b c g-a d g) x^2+2 b^3 d^3 (b c-a d) g^4 x^3+6 d^4 (b f-a g)^4 \log (a+b x)-6 b^4 (d f-c g)^4 \log (c+d x)\right )}{6 b^4 d^4}}{4 g} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.05, size = 0, normalized size = 0.00 \[\int \left (g x +f \right )^{3} \left (A +B \ln \left (e \left (\frac {b x +a}{d x +c}\right )^{n}\right )\right )\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 447, normalized size = 1.90 \begin {gather*} \frac {1}{4} \, B g^{3} x^{4} \log \left ({\left (\frac {b x}{d x + c} + \frac {a}{d x + c}\right )}^{n} e\right ) + \frac {1}{4} \, A g^{3} x^{4} + B f g^{2} x^{3} \log \left ({\left (\frac {b x}{d x + c} + \frac {a}{d x + c}\right )}^{n} e\right ) + A f g^{2} x^{3} + \frac {3}{2} \, B f^{2} g x^{2} \log \left ({\left (\frac {b x}{d x + c} + \frac {a}{d x + c}\right )}^{n} e\right ) + \frac {3}{2} \, A f^{2} g x^{2} - \frac {1}{24} \, B g^{3} n {\left (\frac {6 \, a^{4} \log \left (b x + a\right )}{b^{4}} - \frac {6 \, c^{4} \log \left (d x + c\right )}{d^{4}} + \frac {2 \, {\left (b^{3} c d^{2} - a b^{2} d^{3}\right )} x^{3} - 3 \, {\left (b^{3} c^{2} d - a^{2} b d^{3}\right )} x^{2} + 6 \, {\left (b^{3} c^{3} - a^{3} d^{3}\right )} x}{b^{3} d^{3}}\right )} + \frac {1}{2} \, B f g^{2} n {\left (\frac {2 \, a^{3} \log \left (b x + a\right )}{b^{3}} - \frac {2 \, c^{3} \log \left (d x + c\right )}{d^{3}} - \frac {{\left (b^{2} c d - a b d^{2}\right )} x^{2} - 2 \, {\left (b^{2} c^{2} - a^{2} d^{2}\right )} x}{b^{2} d^{2}}\right )} - \frac {3}{2} \, B f^{2} g n {\left (\frac {a^{2} \log \left (b x + a\right )}{b^{2}} - \frac {c^{2} \log \left (d x + c\right )}{d^{2}} + \frac {{\left (b c - a d\right )} x}{b d}\right )} + B f^{3} n {\left (\frac {a \log \left (b x + a\right )}{b} - \frac {c \log \left (d x + c\right )}{d}\right )} + B f^{3} x \log \left ({\left (\frac {b x}{d x + c} + \frac {a}{d x + c}\right )}^{n} e\right ) + A f^{3} x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 465 vs.
\(2 (224) = 448\).
time = 0.46, size = 465, normalized size = 1.98 \begin {gather*} \frac {6 \, {\left (A + B\right )} b^{4} d^{4} g^{3} x^{4} + 2 \, {\left (12 \, {\left (A + B\right )} b^{4} d^{4} f g^{2} - {\left (B b^{4} c d^{3} - B a b^{3} d^{4}\right )} g^{3} n\right )} x^{3} + 3 \, {\left (12 \, {\left (A + B\right )} b^{4} d^{4} f^{2} g - {\left (4 \, {\left (B b^{4} c d^{3} - B a b^{3} d^{4}\right )} f g^{2} - {\left (B b^{4} c^{2} d^{2} - B a^{2} b^{2} d^{4}\right )} g^{3}\right )} n\right )} x^{2} + 6 \, {\left (4 \, B a b^{3} d^{4} f^{3} - 6 \, B a^{2} b^{2} d^{4} f^{2} g + 4 \, B a^{3} b d^{4} f g^{2} - B a^{4} d^{4} g^{3}\right )} n \log \left (b x + a\right ) - 6 \, {\left (4 \, B b^{4} c d^{3} f^{3} - 6 \, B b^{4} c^{2} d^{2} f^{2} g + 4 \, B b^{4} c^{3} d f g^{2} - B b^{4} c^{4} g^{3}\right )} n \log \left (d x + c\right ) + 6 \, {\left (4 \, {\left (A + B\right )} b^{4} d^{4} f^{3} - {\left (6 \, {\left (B b^{4} c d^{3} - B a b^{3} d^{4}\right )} f^{2} g - 4 \, {\left (B b^{4} c^{2} d^{2} - B a^{2} b^{2} d^{4}\right )} f g^{2} + {\left (B b^{4} c^{3} d - B a^{3} b d^{4}\right )} g^{3}\right )} n\right )} x + 6 \, {\left (B b^{4} d^{4} g^{3} n x^{4} + 4 \, B b^{4} d^{4} f g^{2} n x^{3} + 6 \, B b^{4} d^{4} f^{2} g n x^{2} + 4 \, B b^{4} d^{4} f^{3} n x\right )} \log \left (\frac {b x + a}{d x + c}\right )}{24 \, b^{4} d^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 6660 vs.
\(2 (224) = 448\).
time = 5.35, size = 6660, normalized size = 28.34 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.74, size = 766, normalized size = 3.26 \begin {gather*} x\,\left (\frac {4\,A\,b\,d\,f^3+12\,A\,a\,c\,f\,g^2+12\,A\,a\,d\,f^2\,g+12\,A\,b\,c\,f^2\,g+6\,B\,a\,d\,f^2\,g\,n-6\,B\,b\,c\,f^2\,g\,n}{4\,b\,d}+\frac {\left (4\,a\,d+4\,b\,c\right )\,\left (\frac {\left (\frac {4\,A\,a\,d\,g^3+4\,A\,b\,c\,g^3+12\,A\,b\,d\,f\,g^2+B\,a\,d\,g^3\,n-B\,b\,c\,g^3\,n}{4\,b\,d}-\frac {A\,g^3\,\left (4\,a\,d+4\,b\,c\right )}{4\,b\,d}\right )\,\left (4\,a\,d+4\,b\,c\right )}{4\,b\,d}-\frac {4\,A\,a\,c\,g^3+12\,A\,a\,d\,f\,g^2+12\,A\,b\,c\,f\,g^2+12\,A\,b\,d\,f^2\,g+4\,B\,a\,d\,f\,g^2\,n-4\,B\,b\,c\,f\,g^2\,n}{4\,b\,d}+\frac {A\,a\,c\,g^3}{b\,d}\right )}{4\,b\,d}-\frac {a\,c\,\left (\frac {4\,A\,a\,d\,g^3+4\,A\,b\,c\,g^3+12\,A\,b\,d\,f\,g^2+B\,a\,d\,g^3\,n-B\,b\,c\,g^3\,n}{4\,b\,d}-\frac {A\,g^3\,\left (4\,a\,d+4\,b\,c\right )}{4\,b\,d}\right )}{b\,d}\right )-x^2\,\left (\frac {\left (\frac {4\,A\,a\,d\,g^3+4\,A\,b\,c\,g^3+12\,A\,b\,d\,f\,g^2+B\,a\,d\,g^3\,n-B\,b\,c\,g^3\,n}{4\,b\,d}-\frac {A\,g^3\,\left (4\,a\,d+4\,b\,c\right )}{4\,b\,d}\right )\,\left (4\,a\,d+4\,b\,c\right )}{8\,b\,d}-\frac {4\,A\,a\,c\,g^3+12\,A\,a\,d\,f\,g^2+12\,A\,b\,c\,f\,g^2+12\,A\,b\,d\,f^2\,g+4\,B\,a\,d\,f\,g^2\,n-4\,B\,b\,c\,f\,g^2\,n}{8\,b\,d}+\frac {A\,a\,c\,g^3}{2\,b\,d}\right )+x^3\,\left (\frac {4\,A\,a\,d\,g^3+4\,A\,b\,c\,g^3+12\,A\,b\,d\,f\,g^2+B\,a\,d\,g^3\,n-B\,b\,c\,g^3\,n}{12\,b\,d}-\frac {A\,g^3\,\left (4\,a\,d+4\,b\,c\right )}{12\,b\,d}\right )+\ln \left (e\,{\left (\frac {a+b\,x}{c+d\,x}\right )}^n\right )\,\left (B\,f^3\,x+\frac {3\,B\,f^2\,g\,x^2}{2}+B\,f\,g^2\,x^3+\frac {B\,g^3\,x^4}{4}\right )+\frac {A\,g^3\,x^4}{4}-\frac {\ln \left (a+b\,x\right )\,\left (B\,n\,a^4\,g^3-4\,B\,n\,a^3\,b\,f\,g^2+6\,B\,n\,a^2\,b^2\,f^2\,g-4\,B\,n\,a\,b^3\,f^3\right )}{4\,b^4}+\frac {\ln \left (c+d\,x\right )\,\left (B\,n\,c^4\,g^3-4\,B\,n\,c^3\,d\,f\,g^2+6\,B\,n\,c^2\,d^2\,f^2\,g-4\,B\,n\,c\,d^3\,f^3\right )}{4\,d^4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________